<template>
   <ul class="catagtory">
        <li @click="$store.commit('Categtory/updataCurrentCategtory', item.id)"
        :class="{ select: currentCategtory === item.id }"
        v-for="item in categtory"
        :key="item.id">
        {{item.name}}
        </li>
      </ul>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  name: 'Catory',
  computed: {
    ...mapGetters(['categtory', 'currentCategtory'])
  },
  created () {
    this.$store.dispatch('Categtory/getCategtory')
  }
}
</script>

<style>

</style>
